<?php
require_once WEBAPP_DIR.'/application/function/colorSource.php';

$sFileName = $_GET['fileName'];
$sLanguage = $_GET['language'];

if(file_exists($sFileName)){
	$rHandle = fopen($sFileName, 'a+') ;
	$sContentFile = '';
	$sContentLine = fgets($rHandle);
	while($sContentLine = fgets($rHandle)){
		$sContentFile .= $sContentLine;
	}

	$sSourceHighlighted = colorSource($sContentFile, $sLanguage);
}else{ $sSourceHighlighted = 'Le fichier n\'existe pas !'; }

require_once(VIEW_DIR.'/sourceEditor.php');